/**
 * @description 生成随机字符串
 * @param length {number} 字符串长度
 * @param chars {string} 生成选项
 * @returns {string}
 */
const randomString = (length = 6, chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') => {
    let result = '';
    for (let i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
    return result;
};
export default randomString;